
import { createStore, Store, useStore as baseUseStore } from 'vuex' // 导入vuex
export interface IState {
  accessToken: string
}
export type State = {
  count: number
}

export default createStore<IState>({
  state: {
    accessToken: 'this is token',
  },
  mutations: {
    update ({accessToken}, token) {
      accessToken = token
    }
  },
  getters: {
    getAccessToken(state){
      return state.accessToken
  }
  },
  actions: {
  },
  modules: {
  }
})
export function useStore(): Store<IState> {
  return baseUseStore()
}